<!DOCTYPE html>
{{- $language_code := site.LanguageCode | default "en-us" -}}
<html lang="{{$language_code}}" {{ if in site.Data.i18n.rtl.rtl $language_code }}dir="rtl"{{end}}>

{{/* Convert relative permalink to css classes. */}}
{{ $current_rel_permalink_classes := "" }}
{{ if .IsHome }}
  {{ $current_rel_permalink_classes = "page-home" }}
{{ else }}
  {{ $current_rel_permalink_classes = replace (strings.TrimRight "/" .RelPermalink) "/" " page-" }}
{{ end }}

{{ partial "site_head" . }}
<body id="top" data-spy="scroll" data-offset="70" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" class="{{$current_rel_permalink_classes}} {{ if not (.Scratch.Get "light") }}dark{{end}}">

  {{ partial "search" . }}

  {{ partial "navbar" . }}

  {{ block "main" . }}{{ end }}

  {{ partial "site_js" . }}

  {{/* Docs and Updates layouts include the site footer in a different location. */}}
  {{ if not (in (slice "docs" "updates") .Type) }}
  <div class="footer-wrap">
    <div class="container">
      {{ partial "site_footer" . }}
    </div>
  </div>
  {{ end }}

  {{ partial "citation" . }}

</body>
</html>
